Skip to content

Instantly share code, notes, and snippets.

View Rajan's full-sized avatar

rajan Rajan

View GitHub Profile
@jpbecotte
jpbecotte / Vue-cli-3-Phoenix-1.3-HOWTO.md
Last active August 23, 2020 05:32
Vue-cli 3, Phoenix 1.3, a complete how-to

Introduction

I have been struggling to start a new project with Phoenix 1.3 and the new vue-cli 3 for Vue.js. There are tons of example already but none of them suited my needs, because:

  • I want to use the new Vue-cli to select the features that I want,
  • I do NOT want to setup Webpack (I know, what a shame!). The new Vue-cli includes the new vue-cli-service, which uses an instance of webpack-dev-server, so you don't have to import it manually in your project.
  • I do not want to use Brunch.

Create your Phoenix App

Assuming that you have Elixir and Phoenix 1.3 are both installed, let's build our new App.

@hugs
hugs / 1 - setup.md
Last active March 21, 2020 19:59
Elementary OS Setup (Loki)

Post-installation Elementary OS Setup and Tweaks

  • System Settings -> Mouse & Touchpad -> Touchpad -> Tap to click -> (Toggle on)
  • Connect to additional WiFi access points

Apply Updates:

sudo apt-get update
sudo apt-get upgrade

Install Dev Tools:

@claudijo
claudijo / README.md
Last active July 24, 2023 03:52
An Android view for typewriting-like animations

TypewriterView

An Android view that can be used to sequentially animate typing and deleting one character at a time. Pausing and enqueuing arbitrary Runnables is also possible. Inspired by Devunwired @ Stackoverflow (see http://stackoverflow.com/questions/6700374/android-character-by-character-display-text-animation).

An EditText view has been used as base to get a blinking cursor. This has the drawback that the user could edit the text while it is animating. Minimum changes to the code are required to instead use a TextView as base if that is an issue.

Example

TypewriterView typewriterView = (TypewriterView) view.findViewById(R.id.typewriter);
@zealoushacker
zealoushacker / why_iframes_are_good_for_widget_development.md
Last active September 7, 2015 14:35
Why iframes are great for embeddable widget development

Why iframes are good for embeddable widget development

There are generally two ways to build embeddable widgets to be embeddable by an arbitrary widget consuming site, that isn't on the same domain as where the widget is hosted (think stripe checkout, olark chat, or zendesk support widgets as examples):

  1. Render the widget into the embedding site's designated <div> or some other html container element
  2. Render the widget into the embedding site's designated <iframe> element

To be sure, <iframe> is generally a pretty horrible way to go. But, as usual there are tradeoffs, and in one very specific use case, it's pretty great: building embeddable widgets. No, it's not because most other companies of any import that build widgets, with some very smart engineers, use the <iframe> method - I am not one for appeals to authority - and there are some notable exceptions, like olark, though they are probably hating the maintenance of the widget ui and associated css. Primarily, the core reasons why `<ifram

@matthewhartstonge
matthewhartstonge / bootstrap-nav-profile-pic.css
Last active January 31, 2021 22:16
Bootstrap 3 Navbar Profile CSS with HTML Example
/* Bootstrap 3 Navbar Profile Picture CSS
*
* The CSS for profile pictures in the navbar has always annoyed me,
* so here's my fix that appears to have the least hoops.
*
* Production use:
* >Add a div with the specified class.
* >Using JS, change the profile picture CSS URL as needed.
*
* HTML example:
@learncodeacademy
learncodeacademy / generators.md
Last active January 7, 2024 11:58
What are Javascript Generators?

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
 console.log(one, two, three);
@m1entus
m1entus / build-ffmpeg.sh
Last active June 11, 2023 06:42
Installing ffmpeg ios libraries armv7, armv7s, i386
#!/bin/bash
###########################################################################
# Choose your ffmpeg version and your currently-installed iOS SDK version:
#
VERSION="2.0.2"
SDKVERSION="7.0"
ARCHS="armv7 armv7s i386"
#
#
@sharonbn
sharonbn / SslUtil.java
Last active August 21, 2022 05:48
SSL/TLS connection from Eclipse Paho Java client to mosquitto MQTT broker
import java.io.*;
import java.nio.file.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
import org.bouncycastle.jce.provider.*;
import org.bouncycastle.openssl.*;
public class SslUtil
@thefish
thefish / bootstrap-typeahead-objects-array.js
Created September 5, 2012 12:47
twitter bootstrap typeahead modified to work with array of key-value objects.
/* =============================================================
* bootstrap-typeahead.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*