Skip to content

Instantly share code, notes, and snippets.

View edesdan's full-sized avatar

Daniele De Sanctis edesdan

  • Italy
View GitHub Profile
@edesdan
edesdan / permutations.py
Last active November 14, 2018 01:06
Given a word as argument this little program written in python finds all the permutations that have a meaning in the en_US dictionary
#!/usr/bin/python
import sys
import pprint
from PyDictionary import PyDictionary
import itertools
def check(wordToCheck):
meaning = dictionary.meaning(wordToCheck)
if meaning:
pp.pprint(meaning)
@edesdan
edesdan / SplitVideoIntoChunksFFMPEG.md
Created March 14, 2018 20:51
ffmpeg video editing

ffmpeg -i input.mp4 -codec:v mpeg4 -ss 00:00:00 -t 02:00:00 -c copy part1.mp4 -ss 02:00:00 -c copy part2.mp4

@edesdan
edesdan / Quotes.md
Created March 8, 2018 10:20
Quotes from the IT Gurus

If you get a failure in a high level test, not just do you have a bug in your functional code, you also have a missing unit test. Thus whenever you fix a failing end-to-end test, you should be adding unit tests too. — Martin Fowler

@edesdan
edesdan / Mov2Gif.md
Last active March 6, 2018 23:45
OS X Screencast to animated GIF using quicktime + ffmpeg
  1. Record with Quicktime, no audio, save as .mov with full resolution (trim video if necessary).
  2. Make sure you have installed ffmpeg: brew install ffmpeg.
  3. Use the following script to produce the final gif:
#!/bin/sh
  
palette="/tmp/palette.png"

filters="fps=15,scale=640:-1:flags=lanczos"
@edesdan
edesdan / export-to-csv.gs
Created October 26, 2017 11:53 — forked from mderazon/export-to-csv.gs
Google apps script to export to individual csv files all sheets in an open spreadsheet
/*
* script to export data in all sheets in the current spreadsheet as individual csv files
* files will be named according to the name of the sheet
* author: Michael Derazon
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}];
ss.addMenu("csv", csvMenuEntries);
UTC iso 8601: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
iso 8601 with timezone offset: "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
@edesdan
edesdan / .gitignore
Last active February 7, 2024 23:20
A .gitignore file suitable for development with Java, Maven, Gradle, IntelliJ, Android Studio on a MacOS
# Reference: https://github.com/github/gitignore
# From: https://gist.github.com/edesdan/6bb43343740bcd54ef0f56a384a2f66f
######################
###### Mac OS X ######
######################
# Folder view configuration files
.DS_Store
Desktop.ini
@edesdan
edesdan / commandline-notes.md
Last active November 16, 2021 14:04
Command line shell notes - linux

Search

find

find . -type f -size +100M 2>/dev/null |-> recursively find files > 100 MB in size in the current directory
find . -type d "name" |-> find directory with name "name"

grep

grep -nr 'foo*' . |-> recursively find 'foo*' (regex) inside all files in the current directory

Sama: Today we have Elon Musk. Elon, thank you for joining us.

Elon: Thanks for having me.

Sama: So, we want to spend the time today talking about your view of the future and what people should work on. To start off, could you tell us, you famously said, when you were younger, there were five problems that you thought were most important for you to work on. If you were 22 today, what would the five problems that you would think about working on be?

Elon: Well, first of all, I think if somebody is doing something that is useful to the rest of society, I think that's a good thing. Like, it doesn't have to change the world. If you make something that has high value to people... And frankly, even if it's something, if it's like just a little game or some improvement in photo sharing or something, if it has a small amount of good for a large number of people, I think that's fine. Stuff doesn't need to change the world just to be good. But in terms of things that I think are most like to affect t

package playground;
import java.util.ArrayList;
import java.util.List;
public enum DaysOfMonth {
JAN,FEB,MAR;
@Override public final String toString() { return super.toString().toLowerCase(); }