Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Val Neekman (AvidCoder) un33k

🏠
Working from home
View GitHub Profile
View geecalmap.js
$('#coverinner').on(
{
'focus': function(event) {
$(this).autocomplete({
minLength: 3,
source: function(req, res){
$.ajax({
url: 'https://maps.googleapis.com/maps/api/place/autocomplete/json',
data: {
input: req.term,
@un33k
un33k / pistats.sh
Last active Apr 2, 2021
Raspberry Pi Status
View pistats.sh
#!/usr/bin/env bash
# AvidCaster.net
# #############################################################
# sysstat must be installed (e.g. sudo apt-get install sysstat)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
while true
do
TEMP=$(vcgencmd measure_temp);
@un33k
un33k / patch-edid.md
Created Feb 2, 2021 — forked from ejdyksen/patch-edid.md
A script to fix EDID problems on external monitors in macOS
View patch-edid.md

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

View angular-cli-node-js-typescript-support.csv
Angular CLI version Angular version Node.js version TypeScript version
- 2.x 6.0.x or later minor version 2.0.x
1.0.6 4.x 6.9.x or later minor version 2.2.x
1.1.3 4.x 6.9.x or later minor version 2.3.x
1.2.7 4.x 6.9.x or later minor version 2.3.x
1.3.2 4.2.x or later minor version 6.9.x or later minor version 2.4.x
1.4.10 4.2.x or later minor version 6.9.x/8.9.x or later minor version 2.4.x
(1.5.6) 5.0.x 6.9.x/8.9.x or later minor version 2.4.x
1.5.6 5.1.x 6.9.x/8.9.x or later minor version 2.5.x
1.6.7 5.2.x or later minor version 6.9.x/8.9.x or later minor version 2.5.x
View SassMeister-input.scss
// ----
// libsass (v3.3.2)
// ----
$spacer: 1rem;
$spacer-x: $spacer;
$spacer-y: $spacer;
$spacers: ();
@un33k
un33k / walksync.js
Created Mar 7, 2018 — forked from kethinov/walksync.js
List all files in a directory in Node.js recursively in a synchronous fashion
View walksync.js
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
@un33k
un33k / simple_args_parsing.sh
Created Mar 5, 2018 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
View simple_args_parsing.sh
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
View Nativescript String to Base64 String and Vice-Versa.ts
/*
* Convert A String to Base64 String or Vice-Versa
*/
declare const android: any;
declare const java: any;
declare const NSData: any;
declare const NSUTF8StringEncoding: any;
declare const NSString: any;
@un33k
un33k / psql-with-gzip-cheatsheet.sh
Created Oct 5, 2017 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
View psql-with-gzip-cheatsheet.sh
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@un33k
un33k / translateLSLoader.ts
Last active Jan 26, 2017 — forked from ocombe/translateLSLoader.ts
ng2-translate file loader with localstorage to speed up things
View translateLSLoader.ts
import {TranslateLoader} from "ng2-translate/ng2-translate";
import {Observable} from "rxjs/Observable";
import {Response, Http} from "angular2/http";
export class TranslateLSLoader implements TranslateLoader {
constructor(private http: Http, private prefix: string = 'i18n', private suffix: string = '.json') {}
/**
* Gets the translations from the localStorage and update them with the ones from the server
* @param lang