Skip to content

Instantly share code, notes, and snippets.

@josue
josue / pdf-conversion-fun.md
Last active December 10, 2023 15:11
Using ImageMagick to easily: Split, Merge, Remove a page from PDF.

Install Required libraries:

sudo apt-get update && sudo apt-get install imagemagick gs

create directory to test commands

mkdir -p pdf_conversion/{merged,split}
cd pdf_conversion
@Restuta
Restuta / framework-sizes.md
Last active April 19, 2025 05:14
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@Hypercubed
Hypercubed / .gitignore
Last active May 22, 2017 23:44
Bad value context for arguments value
jspm_packages
@dmgottlieb
dmgottlieb / gist:56369e01521c61dd00b6
Created July 15, 2015 18:43
4-tower Tower of Hanoi solutions using μ-recursion in Haskell
import Data.List
import Data.Ord
-- Tower of Hanoi implementation
type Peg = String
type Move = (Peg, Peg)
hanoi :: Integer -> Peg -> Peg -> Peg -> [Move]
hanoi 0 a b c = [ ]
hanoi n a b c = hanoi (n-1) a c b ++ [(a,b)] ++ hanoi (n-1) c b a
@phanan
phanan / runner.js
Last active April 7, 2025 13:42
Record a webpage with PhantomJS and FFMpeg
// Run this from the commandline:
// phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 24 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4
var page = require('webpage').create(),
address = 'http://s.codepen.io/phanan/fullembedgrid/YPLewm?type=embed&safe=true&_t=1424767252279',
duration = 3, // duration of the video, in seconds
framerate = 24, // number of frames per second. 24 is a good value.
counter = 0,
width = 500,
height = 500;
@mathisonian
mathisonian / index.md
Last active August 10, 2024 20:59
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

<html>
<head>
<title>Wordnik demo from JavaScript</title>
<script src="http://static.smallpicture.com/bootstrap/js/jquery-1.9.1.min.js"></script>
<script>
var baseUrl = "http://api.wordnik.com/v4/word.json/";
var apiKey = "a2a73e7b926c924fad7001ca3111acd55af2ffabf50eb4ae5"; //demo key from developer.wordnik.com
function getSynonyms (theWord, callback) {
var url = baseUrl + theWord + "/relatedWords?useCanonical=true&relationshipTypes=synonym&limitPerRelationshipType=100&api_key=" + apiKey;
var jxhr = $.ajax ({
@jasonrudolph
jasonrudolph / github-api-example.md
Created April 15, 2014 12:09
Debugging "Reference update failed" error when creating a branch via the GitHub Git Refs API
@namuol
namuol / INSTALL.md
Last active December 11, 2024 12:21
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@jimkang
jimkang / Default (OSX).sublime-keymap
Last active August 29, 2015 13:56
Sublime group focus/moving keybindings. Goes in ~/Library/Application Support/Packages/User.
[
{ "keys": ["super+shift+,"], "command": "focus_group", "args": { "group": 0 } },
{ "keys": ["super+shift+."], "command": "focus_group", "args": { "group": 1 } },
{ "keys": ["super+shift+/"], "command": "focus_group", "args": { "group": 2 } },
{ "keys": ["alt+super+,"], "command": "move_to_group", "args": { "group": 0 } },
{ "keys": ["alt+super+."], "command": "move_to_group", "args": { "group": 1 } },
{ "keys": ["alt+super+/"], "command": "move_to_group", "args": { "group": 2 } },
{ "keys": ["super+1"], "command": "focus_group", "args": { "group": 0 } },