Skip to content

Instantly share code, notes, and snippets.

View babacarcissedia's full-sized avatar

Babacar Cissé Dia babacarcissedia

View GitHub Profile
@zoparga
zoparga / temp-url-for-local-files.php
Last active February 22, 2024 13:24
Laravel create temp url for files
//AppServiceProvider.php
Storage::disk('local')->buildTemporaryUrlsUsing(function ($path, $expiration, $options) {
return URL::temporarySignedRoute(
'local.temp',
$expiration,
array_merge($options, ['path' => $path])
);
});
@getify
getify / 1.js
Last active June 8, 2019 08:17
race-promises-pool
async function racePromisesPool([ ...prs ] = []) {
var raceWon = false;
var prListeners = prs.map(function listen(pr,idx){
return pr.then(function t(v){
if (!raceWon) {
raceWon = true;
prs.splice(idx,1); // remove the promise from the pool since it won the race
return v;
}
});
@mneedham
mneedham / import.cql
Last active December 4, 2022 11:47
Neo4j Twitter Graph
CREATE CONSTRAINT ON(u:User)
ASSERT u.id IS unique;
:param keysToKeep => ["name", "username", "bio", "following", "followers"];
CALL apoc.load.json("https://gist.github.com/mneedham/3c6a59fb5e7d87e20a2f5f1ae4fa2920/raw/9d7c57997c09b3a105556adb6c6f1819792a4db4/query.json")
YIELD value
MERGE (u:User {id: value.user.id })
SET u += value.user
FOREACH (following IN value.following |
MERGE (f1:User {id: following})
MERGE (u)-[:FOLLOWS]->(f1))
@jtferns
jtferns / cmder_split.md
Last active March 26, 2023 14:39
Create simple 4-way split of Cmder for windows cmd prompting...

Setup

  1. Launch Cmder
  • step1
  1. Right-click on the console tab
  2. Select New Console... to launch the ConEmu console create dialog
  • step2
  1. In the New Console Split section, select the To right radio option click the Start button
  • step3
  1. Congrats, you now have a half-n-half or 50-50 horizontal split!
@mneedham
mneedham / VagueRelationshipTypes.java
Last active February 28, 2021 00:07
All different ways of searching relationships in Neo4j
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.DynamicLabel;
import org.neo4j.graphdb.DynamicRelationshipType;
import org.neo4j.graphdb.GraphDatabaseService;
@anapsix
anapsix / chat.sh
Last active March 18, 2022 18:24
Chat server with Netcat and Bash, inspired by ITA Software 2011 interview challenge
#!/bin/bash
#
# Implementation of BASH + NCAT chat server
#
# Author: Anastas Dancha <anapsix@random.io>
# Contact: anapsix@random.io
#
#debug="true"
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@vasilisvg
vasilisvg / HTML-presentation-tools.md
Created January 14, 2012 13:53
HTML presentation tools

#HTML presentation tools

There are many HTML presentation tools and they are all created for slightly different reasons. Here's an overview. Please let me know if I forgot any.

##CSSS

CSS-based SlideShow System