Skip to content

Instantly share code, notes, and snippets.

View r17x's full-sized avatar
🤘
REconciling...

RiN r17x

🤘
REconciling...
View GitHub Profile
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@aemkei
aemkei / LICENSE.txt
Last active June 4, 2024 07:51 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@zaach
zaach / regex.js
Created July 12, 2012 16:49
origin regex
//var org = /^https?:\/\/(?=.{1,254}(?::|$))(?:(?!\d|-)(?![a-zA-Z0-9\-]{1,62}-\.)[a-zA-Z0-9\-]{1,63}\.)*(?:(?!\d|-)(?![a-zA-Z0-9\-]{1,62}-$)[a-zA-Z0-9\-]{1,63})(:\d+)?$/;
var org = /^https?:\/\/(?=.{1,254}(?::|$))(?:(?!\d|-)(?![a-z0-9\-]{1,62}-(?:\.|:|$))[a-z0-9\-]{1,63}\b(?!\.$)\.?)+(:\d+)?$/i;
/* Origin regex explained
/^ // beginning
https?:\/\/ // starts with http:// or https://
(?=.{1,254}(?::|$)) // the hostname chars must be within 1-254 bytes
@vodik
vodik / SOS.md
Last active May 8, 2024 18:21
_Never_ -Sy when installing!

Once upon a time there was a user that wanted to install firefox.

The user tried to do pacman -S firefox but it didn't work. The all mighty pacman reported that firefox-3.2.4-1.i686.pkg.tar.gz could not be found on his mirror. So the user tried pacman -Sy firefox. It worked and the user rejoiced since he could once again go and troll /h/.

But all was not good. The user had made a grave error!

See, when the user told the almighty pacman to -Sy firefox, pacman did

@hissy
hissy / gist:7352933
Created November 7, 2013 11:07
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,
@Whitexp
Whitexp / facebok ip list
Last active May 19, 2024 06:47
facebook ip list
31.13.24.0/21
31.13.64.0/19
31.13.64.0/24
31.13.69.0/24
31.13.70.0/24
31.13.71.0/24
31.13.72.0/24
31.13.73.0/24
31.13.75.0/24
31.13.76.0/24
@staltz
staltz / introrx.md
Last active June 7, 2024 23:39
The introduction to Reactive Programming you've been missing
@mrash
mrash / mac_timemachine.sh
Last active March 31, 2021 18:17
Emulate encrypted Time Machine backups from a Mac to a Linux system with rsync 'snapshotting' + encfs.
#!/bin/sh -x
#
# Goal: Emulate encrypted Time Machine backups from a Mac to a Linux system
# with rsync 'snapshotting' + encfs. This provides an additional backup
# to a Linux based filesystem like ext4 just in case of HFS+ issues as
# described here: http://blog.barthe.ph/2014/06/10/hfs-plus-bit-rot/
# This is not expected to solve all potential bitrot scenarios - rather
# to provide some redundancy and make detection easier (with additional
# scripting effort).
#
@juyal-ahmed
juyal-ahmed / wp-featured-image-upload-for-front-end.php
Last active February 21, 2018 03:48
Upload featured image on custom post from WordPress front-end
@mrash
mrash / gist:0f12560983a8c2888c5f
Created June 19, 2015 00:17
Transparent gpg encryption / decryption with vim (.vimrc hack) - provides a simple command-line alternative to password managers like LastPass
" Transparent editing of gpg encrypted files.
" By Wouter Hanegraaff <wouter@blub.net>
augroup encrypted
au!
" First make sure nothing is written to ~/.viminfo while editing
" an encrypted file.
autocmd BufReadPre,FileReadPre *.gpg set viminfo=
" We don't want a swap file, as it writes unencrypted data to disk
autocmd BufReadPre,FileReadPre *.gpg set noswapfile
" Switch to binary mode to read the encrypted file