Skip to content

Instantly share code, notes, and snippets.

View parkitny's full-sized avatar
:octocat:

Seb Parkitny parkitny

:octocat:
View GitHub Profile
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active April 7, 2025 18:27
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@Warvito
Warvito / PixelCNN_maskedCNN
Last active April 19, 2022 10:52
Convolutional layers with masks. Convolutional layers with simple implementation of masks type A and B for autoregressive models.
class MaskedConv2D(keras.layers.Layer):
"""Convolutional layers with masks.
Convolutional layers with simple implementation of masks type A and B for
autoregressive models.
Arguments:
mask_type: one of `"A"` or `"B".`
filters: Integer, the dimensionality of the output space
(i.e. the number of output filters in the convolution).
@mcapodici
mcapodici / FreeCheapBS.md
Last active June 20, 2019 05:07
Excellent Free or V.Cheap tools ans services for bootstrapping a side project

This is a braindump of excellent tools & services that are free or really cheap that you can use to bootstrap something on the side.

I only include services with a generous enough free-tier plan that you can probably use it for a long time before needing to ugrade, reducing the pressure to make money from the beginning.

Email Services

Regular Email Service

  • Zoho: https://www.zoho.com/mail/ - offers a generious free tier that allows you to connect a single domain name, and a pretty decent user interface. They provide a catchall facility so you can receive emails on many different aliases.
@korakot
korakot / record.py
Last active April 24, 2025 14:08
Record audio in Colab using getUserMedia({ audio: true })
# all imports
from IPython.display import Javascript
from google.colab import output
from base64 import b64decode
from io import BytesIO
!pip -q install pydub
from pydub import AudioSegment
RECORD = """
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
@matthiassb
matthiassb / dns-sync.sh
Last active August 24, 2024 09:43
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@yurydelendik
yurydelendik / record.html
Last active August 3, 2021 06:39
Record and playback audio.
<!DOCTYPE html>
<html>
<head>
<title>Capture sound</title>
<meta charset="utf-8">
</head>
<body>
<div id="ask_donate">
<button id="donate">Donate the noise</button>
</div>
@alexlee-gk
alexlee-gk / configure_cuda_p70.md
Last active March 10, 2025 15:31
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

@gokulkrishh
gokulkrishh / media-query.css
Last active May 7, 2025 06:24
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@dynamicguy
dynamicguy / install-opencv-2.4.11-in-ubuntu.sh
Last active April 3, 2024 20:20
install opencv-2.4.11 in ubuntu
# install dependencies
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev
@tahirm
tahirm / mysqldump.sql
Created March 27, 2014 13:44
mysqldump command to dump a remote database in locally. #db #sql #mysql #mysqldump #remote
mysqldump -u USER -p -h dev.incuray.com DATABASE > /path/to/output/file/DATABASE.sql;