Skip to content

Instantly share code, notes, and snippets.

@ahmadshah
ahmadshah / randomizer.ex
Created Sep 1, 2016
Random string in elixir
View randomizer.ex
defmodule Randomizer do
@moduledoc """
Random string generator module.
"""
@doc """
Generate random string based on the given legth. It is also possible to generate certain type of randomise string using the options below:
* :all - generate alphanumeric random string
* :alpha - generate nom-numeric random string
@gileri
gileri / Send multiple floats from Arduino to Raspberry through I2C
Last active Nov 20, 2019
Sending float from arduino to raspberry pi using Wire (arduino) and smbus (python) libraries
View Send multiple floats from Arduino to Raspberry through I2C
http://bradsrpi.blogspot.fr/2013/03/sending-data-from-arduino-to-raspberry.html
@afonsomatos
afonsomatos / now.js
Created Jan 3, 2015
Most accurate javascript timing
View now.js
// Most accurate javascript timing
now = function() {
return performance.now()||
performance.mozNow() ||
performance.msNow() ||
performance.oNow() ||
performance.webkitNow() ||
Date.now() ||
new Date().getTime();
@hugorodgerbrown
hugorodgerbrown / postgres_table_row_count.sql
Created Mar 4, 2013
Row counts for all tables in a postgres db.
View postgres_table_row_count.sql
SELECT schemaname,relname,n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;
@Seneral
Seneral / SerializableAction.cs
Last active Nov 20, 2019
Fully capable SerializableAction for Unity. Supports targets of both UnityEngine.Object and System.Object and one-layer serialization of unserializable types. Supports static and generic methods and classes; Supports most anonymous actions, fully capable of using the context. Support: forum.unity3d.com/threads/406299
View SerializableAction.cs
namespace SerializableActionHelper
{
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Reflection;
@gardart
gardart / active-directory-ad-health.md
Created Nov 20, 2019
AD Health & Security Check-up
View active-directory-ad-health.md
@prerakmody
prerakmody / velodyne_lidar_pcap_reader.py
Last active Nov 20, 2019
Convert .pcap files captured from Velodyne into xyz ascii format
View velodyne_lidar_pcap_reader.py
# from scapy3k.all import *
import sys
print (' - Encoding : ', sys.getdefaultencoding())
# print (' - Version : ', sys.version)
import math
import pprint
import datetime
import pandas as pd
from scapy.all import * #https://scapy.readthedocs.io/en/latest/installation.html
View bashstyle.md

progrium/bashstyle

Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne

@yoavniran
yoavniran / gitbashAdmin.bat
Created Jul 14, 2015
ConEmu - Run GitBash as Admin
View gitbashAdmin.bat
"%ConEmuDrive%\Program Files (x86)\Git\bin\sh.exe" --login -i -new_console:a
View gist:652be052a0727ad59601

[공통] 마크다운 markdown 작성법

1. 마크다운에 관하여

1.1. 마크다운이란?

Markdown은 텍스트 기반의 마크업언어로 2004년 존그루버에 의해 만들어졌으며 쉽게 쓰고 읽을 수 있으며 HTML로 변환이 가능하다. 특수기호와 문자를 이용한 매우 간단한 구조의 문법을 사용하여 웹에서도 보다 빠르게 컨텐츠를 작성하고 보다 직관적으로 인식할 수 있다. 마크다운이 최근 각광받기 시작한 이유는 깃헙(https://github.com) 덕분이다. 깃헙의 저장소Repository에 관한 정보를 기록하는 README.md는 깃헙을 사용하는 사람이라면 누구나 가장 먼저 접하게 되는 마크다운 문서였다. 마크다운을 통해서 설치방법, 소스코드 설명, 이슈 등을 간단하게 기록하고 가독성을 높일 수 있다는 강점이 부각되면서 점점 여러 곳으로 퍼져가게 된다.

1.2. 마크다운의 장-단점

1.2.1. 장점

You can’t perform that action at this time.