Skip to content

Instantly share code, notes, and snippets.

@andsens
andsens / debian-init.sh
Last active October 5, 2021 09:38
This is a generic init-script, easily modifiable to suit your needs. It uses quite a lot of lsb init-functions and adheres to the lsb standards.
#!/bin/sh
### BEGIN INIT INFO
# Provides: generic-prog
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Generic Program
# Description: Generic Program is a generic program to do generic things with
### END INIT INFO
@vinaysolanki
vinaysolanki / Increase Youtube View Count
Last active April 12, 2025 11:42
Increase Youtube view count with this JS code Usage: Play a video and open console in chrome and enter increaseCount(views,interval) Eg: increaseCount(2000,10)
var z=0;
var newcount;
function increaseCount(views,interval){
setTimeout(function(){
var viewcount = document.getElementById("watch7-views-info").children[0].innerHTML;
newcount = parseInt(viewcount.replace(',','').replace(',',''));
newcount++;
document.getElementById("watch7-views-info").children[0].innerHTML = addCommas(newcount);
@umidjons
umidjons / index.html
Last active January 6, 2024 18:46
Upload File using jQuery.ajax() with progress support
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload File using jQuery.ajax() with progress support</title>
</head>
<body>
<input type="file" name="file" id="sel-file"/>
@damphat
damphat / apt-rdepends-tree
Last active April 1, 2025 18:24
debian dependency tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@benwurth
benwurth / BasicEqualizerGenerator.jsx
Created September 21, 2013 00:33
A simple script for Adobe After Effects that generates 10 separate null objects with keyframe data for different audio frequency bands. You can then use these nulls to set up a responsive graphical equalizer (frequency analyzer).
{
//Begin Undo group
app.beginUndoGroup("Generate Graphical Equalizer");
/*Variables:*/
//How far apart each null is placed across the screen
var nullPlacementWidth = 0;
//Creates a variable that holds the selected comp
var curItem = app.project.activeItem;
//Creates an array that stores the lowpass values and the highpass values
@j8
j8 / git_empty_branch
Created February 14, 2014 08:32
Create new branch with empty folder structure
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory:
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@bullshit
bullshit / Install Docker on Raspberry Pi (Arch Linux).md
Created April 11, 2014 21:22
Install Docker on Raspberry Pi (Arch Linux)

Install Docker on Raspberry Pi (Arch Linux)

Prepare SD Card

  1. Download Image
  2. Unzip Image
  3. Copy Image on SD Card (dd if=./ArchLinuxARM-2014.03-rpi.img of=/dev/disk2)
  4. Boot Raspberry Pi

Connect to Pi

  1. Find out IP
@max-mapper
max-mapper / 0.md
Last active March 7, 2025 13:39
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@eramdam
eramdam / 01-browser.js
Last active April 8, 2024 06:00
Downloading FB stickers
// Open facebook.com/messages and the stickers pop-up, click on a Facebook Sticker set, open up your JS console and paste this
function dumpStickers() {
URLs = [];
URLs.push(document.querySelectorAll('._5r8a._5r8b')[0].getAttribute('aria-label'));
[].slice.call(document.querySelectorAll('._5r8h')).forEach(function (el) {
URLs.push(el.querySelector('div').style.backgroundImage.replace('url(','').replace(')','').replace('p64','p128').replace('x64','x128'));
});
return URLs;
}
copy(dumpStickers());