Skip to content

Instantly share code, notes, and snippets.

View ac1dr3d's full-sized avatar
:shipit:
follow the white rabbit.

აკაკი ტყემალაძე ac1dr3d

:shipit:
follow the white rabbit.
View GitHub Profile
@mo3aser
mo3aser / fix-infinite-redirect.php
Last active June 16, 2020 18:39
infinite redirect on static front page WordPress
<?php
/**
* Plugin Name: Fix infinite redirect on static front page
* Description: Use this simple plugin to Fix infinite redirect on static front page with some WordPress versions
* Plugin URI: https://tielabs.com/
* Author: TieLabs
* Author URI: https://tielabs.com
* Version: 0.1.0
* License: GPLv2 or later
*/
@sid24rane
sid24rane / net.js
Last active March 30, 2025 23:09
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});

This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
@Yimiprod
Yimiprod / difference.js
Last active April 6, 2025 09:16
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 24, 2025 18:58
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@whoshuu
whoshuu / curlget.cpp
Created March 31, 2015 06:44
Example libcurl GET request
#include <curl/curl.h>
#include <string>
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) {
data->append((char*) ptr, size * nmemb);
return size * nmemb;
}
int main(int argc, char** argv) {
auto curl = curl_easy_init();
@verma
verma / postwalk.clj
Last active September 6, 2019 06:10
pre-walk vs. post-walk
:profile_data
:ber
:value
11
[:value 11]
{:value 11}
[:ber 11]
:event_type
:value
foo
@larruda
larruda / unquoted_json_fix.js
Last active November 22, 2022 09:49
REGEX to add quotes to JSON unquoted keys (turns an invalid JSON into a valid one).
json_string.replace(/(\s*?{\s*?|\s*?,\s*?)(['"])?([a-zA-Z0-9]+)(['"])?:/g, '$1"$3":');
eval('var json = new Object(' + json_string + ')');
@tobysteward
tobysteward / BlogController.php
Last active January 2, 2025 07:28
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name