Skip to content

Instantly share code, notes, and snippets.

View amjarmed's full-sized avatar
🏡
working from home

Mohamed Amjar amjarmed

🏡
working from home
View GitHub Profile
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@gunhansancar
gunhansancar / LocaleHelper.java
Last active April 8, 2021 12:34
While developing your awesome application, sometimes you are required to add a language change feature to your app on the fly. However, Android OS does not directly support this behaviour. And therefore, you need to solve this situation in some other ways. For more details see http://gunhansancar.com/change-language-programmatically-in-android/
package com.gunhansancar.changelanguageexample.helper;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.preference.PreferenceManager;
@Restuta
Restuta / framework-sizes.md
Last active September 19, 2024 15:32
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@J2TEAM
J2TEAM / Blogger-random-post-2.js
Last active May 30, 2018 23:45
Get a random post by using Blogger Feeds API.
function getRandomPost(t){var o=t.feed.entry,n=o[Math.floor(Math.random()*o.length)];window.top.location.href=n.link[4].href}function loadScript(t){var o,n=document.getElementsByTagName("script")[0];o=document.createElement("script"),o.src=t,n.parentNode.insertBefore(o,n)}function randomButtonHandle(){var t=window.top.location,o=t.protocol+"//"+t.hostname+"/feeds/posts/default?alt=json-in-script&max-results=100&callback=getRandomPost";loadScript(o)}randomButtonHandle();
@mindplace
mindplace / git_and_github_instructions.md
Last active November 15, 2024 13:15
Pushing your first project to github

1. Make sure git is tracking your project locally

Do you need a refresher on git? Go through Codecademy's git course.

  1. Using your terminal/command line, get inside the folder where your project files are kept: cd /path/to/my/codebase. → You cannot do this simply by opening the folder normally, you must do this with the command line/terminal.
    → Do you need a refresher on using your command line/terminal? I've compiled my favorite resources here.

  2. Check if git is already initialized: git status

anonymous
anonymous / Entire youtube playlist using idm.md
Created July 11, 2017 11:26
Entire youtube playlist using idm

File: Download Entire youtube playlist using idmidm playlist download youtube multi downloader v3 bulk youtube video downloader youtube multi download how to download full playlist from youtube online how to download youtube playlist using idm grabber how to download youtube playlist videos at once how to download youtube playlist using idm in chrome   17 Feb 2017 Do you want to watch YouTube videos offline? apps and tools that will let you download an entire YouTube playlist in just a few easy clicks. This article identifies six awesome VLC features and explains how to use them. Free youtube downloader online, free youtube video downloader online, download Downloader PC and Mac : Download youtube playlist, channel,8K ,4K ,2K. Youtube Multi Downloader is always f

@bradtraversy
bradtraversy / npmcrashcourse.txt
Last active September 29, 2024 21:04
NPM Crash Course Commands
# GET VERSION
npm -v (or --version)
# GET HELP
npm help
npm
# CREATE PACKAGE.JSON
npm init
npm init -y (or --yes)
@kamleshkarwande
kamleshkarwande / connectWifiAndroidShell.sh
Last active April 24, 2023 21:11
shell script to connect android devices over wifi.
#!/bin/bash
echo "This script works with ONLY one Android device connected to system !!!"
echo "Killing adb"
adb kill-server
sleep 2
PORT_NO=6969
CONNETED_DEVICES=$(adb devices | wc -l)
if [ "$CONNETED_DEVICES" -le 2 ]; then
echo "NO Android device connected to your machine via USB."
else
@andijakl
andijakl / WebAccess.kt
Created January 24, 2019 21:32
Retrofit instance created through Singleton pattern in Kotlin using lazy initialization
package com.andresjakl.partslist
import android.util.Log
import com.jakewharton.retrofit2.adapter.kotlin.coroutines.CoroutineCallAdapterFactory
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
// Singleton pattern in Kotlin: https://kotlinlang.org/docs/reference/object-declarations.html#object-declarations
object WebAccess {
val partsApi : PartsApiClient by lazy {
@micjabbour
micjabbour / install-ycm-termux.md
Last active March 25, 2024 05:18
How to install YouCompleteMe on Termux

How to install YouCompleteMe on Termux

Problem

As of March 2021, YouCompleteMe compiles fine on Termux, but it crashes once the plugin is loaded. The following error can be noticed in the logs:

ImportError: dlopen failed: cannot locate symbol "_ZNSt6__ndk14__fs10filesystem18__weakly_canonicalERKNS1_4pathEPNS_10error_codeE" referenced by "/data/data/com.termux/files/home/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so"...